package com.lxf.education.controller;

import javax.annotation.Resource;

import com.lxf.education.service.ResultService;
import com.lxf.education.utils.ResultVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
* @author:LuoXingFa;
* @version:Date:2022年4月27日上午9:30:38
*/
@Controller
@RequestMapping("/res")
public class ResultListController {
	   
	   //映射出service类
	   @Resource
	   ResultService resultservice;
	   
	   //查询出数据
	   @RequestMapping("/list")
	   @ResponseBody
	   public ResultVo getAllList() {
		   
		   ResultVo resoultVo = resultservice.findAll();
		   
		   return resoultVo;
	}
	   

	    /**
	     * 分页查询
	     * @param page 页码
	     * @param limit 每行显示条数
	     * @return
	     */
	    @RequestMapping("/findByPage")
	    @ResponseBody
	    public ResultVo getResultList(Integer page, Integer limit) {

	        ResultVo resultVo = resultservice.getResultByPage(page,limit);
	        return resultVo;
	    }
	
}
